package com.threadmethod.productdata;

/**
 * @PackageName:com.threadmethod.productdata
 * @ClassName:Test
 * @Description: 测试多生产，多消费的情况
 * @Author: zhangxiaoyu
 * @date 2021/1/18 13:48
 */
public class Test01 {

    public static void main(String[] args){
         ValueOP valueOP = new ValueOP();

         ProducerThread p = new ProducerThread(valueOP);
         ConsumerThread c = new ConsumerThread(valueOP);

        ProducerThread p1 = new ProducerThread(valueOP);
        ConsumerThread c1 = new ConsumerThread(valueOP);

        ProducerThread p2 = new ProducerThread(valueOP);
        ConsumerThread c2 = new ConsumerThread(valueOP);

        p.start();
        c.start();
        p1.start();
        c1.start();
        p2.start();
        c2.start();

         //生产与消费交替运行
    }

}
